package store.lunangangster.engine.bpmn.parser.handler;

import store.lunangangster.bpmn.model.Activity;
import store.lunangangster.bpmn.model.FlowElement;
import store.lunangangster.bpmn.model.SubProcess;
import store.lunangangster.engine.bpmn.parser.BpmnParser;
import store.lunangangster.engine.impl.bpmn.behavior.SubProcessBehavior;

public class SubProcessParseHandler extends
    ActivityParseHandler<SubProcess> {

  @Override
  public void handle0(BpmnParser bpmnParser, SubProcess subProcess) {

    subProcess.setBehavior(new SubProcessBehavior());

    for (FlowElement flowElement : subProcess.getFlowElements().values()) {
      bpmnParser.getBpmnParseHandlers().handleElement(bpmnParser, flowElement);
    }
  }

  @Override
  public Class<? extends Activity> getType() {
    return SubProcess.class;
  }
}
